package txyz;

import java.util.Scanner;

public class code03 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String shuzi = scanner.next();
        int count = 0;
        char[] charArray = shuzi.toCharArray();


        for (int i = 0; i < charArray.length-1; i++) {
            //动态规划

        }


        //判断是否为质数
        if (isZhishu(count)){
            count ++;
        }
        System.out.println(count);
    }

    //判断是否为质数
    private static boolean isZhishu(int shuzi) {
        int num = Integer.parseInt(String.valueOf(shuzi));
        for (int i = 2; i < num; i++) {
            if (num % i == 0)
                return false;
        }
        return true;
    }
}
